package com.frxuexi.lib_base.room

import android.content.Context
import androidx.room.Database
import androidx.room.Room
import androidx.room.RoomDatabase
import dagger.hilt.android.qualifiers.ApplicationContext

@Database(entities = [User::class,AskLeave::class,Task::class], version = 1, exportSchema = false)
abstract class AppDataBase :RoomDatabase(){
    abstract fun userDao():UserDao
    abstract fun askDao():AskDao

    abstract fun taskDao():TaskDao

    companion object{
        fun init(@ApplicationContext context: Context):AppDataBase{
            return Room.databaseBuilder(context,AppDataBase::class.java,"mdm2203")

                .build()
        }
    }
}